package cn.chia.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.chia.front.dao.IOrderFrontDAO;
import cn.chia.front.dao.IShopcarDAO;
import cn.chia.pojo.Orderitems;
import cn.chia.pojo.TblShopcar;
import cn.chia.pojo.User;
import cn.chia.service.IShopcarService;

@Service
public class ShopcarServiceImpl implements IShopcarService{

	private IShopcarDAO shopcarDAOImpl;
	
	private IOrderFrontDAO orderFrontDAO;

	public void delete(Integer id) throws Exception {
		// TODO Auto-generated method stub
		shopcarDAOImpl.doRemove(id);
	}

	public List<TblShopcar> findAll() throws Exception {
		// TODO Auto-generated method stub
		return shopcarDAOImpl.findAll();
	}

	public void insert(TblShopcar shopcar) throws Exception {
		// TODO Auto-generated method stub
		shopcarDAOImpl.doCreate(shopcar);
	}

	public void update(TblShopcar shopcar) throws Exception {
		// TODO Auto-generated method stub
		shopcarDAOImpl.doUpdate(shopcar);
	}

	@Resource(name="shopcarDAOImpl")
	public void setShopcarDAOImpl(IShopcarDAO shopcarDAOImpl) {
		this.shopcarDAOImpl = shopcarDAOImpl;
	}

	public List<TblShopcar> findAll(User user) throws Exception {
		// TODO Auto-generated method stub
		return shopcarDAOImpl.findAll(user);
	}

	public List<Orderitems> findAllOrderitems(int id) throws Exception {
		// TODO Auto-generated method stub
		return orderFrontDAO.findAllOrderitems(id);
	}

	@Resource(name="orderFrontDAOImpl")
	public void setOrderFrontDAO(IOrderFrontDAO orderFrontDAO) {
		this.orderFrontDAO = orderFrontDAO;
	}
	
	
}
